home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Speccy ClassiX 1998
/
Speccy ClassiX 98.iso
/
amiga_system
/
the_aminet
/
util
/
misc
/
cookie21.lha
/
Cookie
/
cookhash.lex
< prev
next >
Wrap
Text File
|
1995-04-27
|
634b
|
51 lines
/*
* cookhash 2.0
* J÷rgen Grahn 1995-04-27
*
* generates file for random selection of cookies
* from a fortune cookie file
*
* cookhash <cookiefile >hashfile
*
* format of the cookie file:
*
* comment
* cookie
* comment
* cookie
* ...
* comment
* cookie
*
* where 'comment' is a bunch of rows starting with '%%'
*
*
* Compile with 'flex' and then an ANSI C compiler.
*
*/
int filepos = 0;
static char verstring[] = "$" "VER: cookhash 2.0 (27.4.95)";
%%
(\%\%.*\n)+ {
filepos += yyleng;
printf("%06lx\n",filepos);
}
(.|\n) {
filepos += yyleng;
}
%%
main()
{
yylex();
exit(0);
}